<!DOCTYPE html>
<html>
<head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta http-equiv="Cache-control" content="max-age=0" />
		<meta http-equiv="Expires" content="0" />
		<meta http-equiv="Pragma" content="no-cache" />
		<script type="text/javascript" src="easyui/jquery.min.js"></script>
		<script type="text/javascript" src="easyui/jquery.easyui.min.js"></script>
		<script type="text/javascript" src="easyui/locale/easyui-lang-zh_CN.js" ></script>
		<script type="text/javascript" src="js/loading.js"></script>
		<script type="text/javascript" src="js/fastCheckIn.js"></script>
		<link rel="stylesheet" type="text/css" href="easyui/themes/default/easyui.css"/>
		<link rel="stylesheet" type="text/css" href="easyui/themes/icon.css" />
		<link rel="stylesheet" type="text/css" href="easyui/demo/demo.css"/>
		<link rel="stylesheet" type="text/css" href="easyui/themes/color.css" />
		<link rel="stylesheet" rev="stylesheet" href="css/style.css" type="text/css" media="all" />
		<title>快速登记</title>
		<style>
			td ul{
				list-style-type:none;
				display: inline;
			}
			td ul li{
				float: left;
				width: 48.5%;
			}
		</style>
</head>
<body>
	<div id="buttonArea" style="width:100%">
			<table style="width:100%; border:0" cellpadding="0" cellspacing="0" class="CContent">
				<tr >
					<th style="width:100%" class="tablestyle_title" align="left"><img src="images/icon_1.png" height="28" width="45"/>添加事件</th>
				</tr>
				<tr>
					<td style="background-color:#ccc;line-height:20px;width:100%" id="tool">
						<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-save" plain="true" onclick="saveEvent()">保存事件</a>
						<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-redo" plain="true" onclick="sendEmail()">发送邮件给报案人</a>
						<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-redo" plain="true" onclick="sendSMS()">发送短信给负责人</a>
						<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-redo" plain="true" onclick="uploadAudio()">上传录音</a>
						<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-redo" plain="true" onclick="uploadImage()">上传图片</a>
						<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-redo" plain="true" onclick="printEvent()">打印</a>
					</td>
				</tr>
				<tr>
					<td>
					<ul>
						<li>
							<fieldset style="height:98%;" >
								<legend>
									上传录音
								</legend>
								<div id="audioBox"></div>
								<form action="" id="audioForm" enctype="multipart/form-data" method="post">
									<input type="file" name="file" id="audioFile"/>
									<span id="uploadAudioLoading"></span>
									<input type="hidden" id="eventId2" name="eventId" value="" />
								</form>
							</fieldset>
						</li>
						<li>
								<fieldset style="height:98%;">
									<legend>
										上传图片
									</legend>
									<div id="imageBox"></div>
									<form action="" id="imageForm" enctype="multipart/form-data" method="post">
										<input type="file" name="file" id="imageFile"/>
										<span id="uploadImageLoading"></span>
										<input type="hidden" id="eventId3" name="eventId" value="" />
									</form>
								</fieldset>
						</li>
					</ul>
					</td>
				</tr>
			</table>
		</div><!--end of button Area !-->
		<div id="find">
			<fieldset>
			<legend>查询报案人</legend>
			<table cellpadding="5px">
				<tr>
					<td width="10%"><font color="blue">报案人类型</font></td>
					<td width="6%" style="padding:0,10px">
						<select class="easyui-combobox" id="victimeType" name="victimeType" required="true" style="height:22px">
							<option value="学生">学生</option>
							<option value="教职工">教职工</option>
						</select>
					</td>
					<td width="10%" ><font color="blue">查询依据</font></td>
					<td width="10%">
						<select id="findBy" name="findBy" class="easyui-combobox">
							<option value="姓名">姓名</option>
							<option value="学号">学号</option>
						</select>
					</td>
					<td width="100px"><input class="easyui-textbox" type="text" required="true" id="keyword" name="keyword"/></td>
					<td><a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-search" onclick="find();">检索</a></td>
				</tr>
			</table>
			</fieldset>
		</div>
		<div id="parent">
			<div id="info" style="margin-left:100px">
			</div>
		</div>
		<div id="detail">
		<fieldset>
			<legend>报案人基本信息</legend>
		  <form id="victimeForm" name="victimeForm">
			<div id="student">
						<table>
							<tr>
								<td width="10%"><span>年级</span></td>
								<td width="15%">
									<input id="grade" name="grade" class="easyui-textbox" type="text" />
								</td>
								<td width="10%"><span>院系</span></td>
								<td width="15%">
									<input class="easyui-textbox " id="stud_academy" name="stud_academy"  type="text" />
								</td>
								<td width="10%"><span>专业</span></td>
								<td width="15%">
									<input class="easyui-textbox " id="stud_major" name="stud_major"
									        type="text" />
								</td>
								<td width="10%"><span>班级</span></td>
								<td width="15%">
									<input class="easyui-textbox" id="className" name="className"
									        type="text" />
								</td>
							</tr><!--end of tr 1!-->
							<tr>
								<td width="10%">性别</td>
								<td>
									<input class="easyui-textbox" id="gender" name="gender"  type="text" />
								</td>
								<td width="10%">姓名</td>
								<td width="15%">
									<input class="easyui-textbox" id="stud_name" name="stud_name"  type="text" />
								</td>
								<td width="10%">学号</td>
								<td width="15%">
									<input class="easyui-textbox" id="stud_id" name="stud_id"  type="text"  />
								</td>							
								<td width="10%"><span>宿舍号</span></td>
								<td width="15%">
									<input id="stu_room" name="stu_room" class="easyui-textbox"  type="text" />
								</td>
							</tr>
							<tr>
								<td width="10%"><span>报案电话</span></td>
								<td width="15%">
									<input id="reporterPhone" name="reporterPhone" class="easyui-textbox" type="text" required="true" />
								</td>
								<td width="10%"><span>联系电话</span></td>
								<td width="15%">
									<input id="contactPhone" name="contactPhone" class="easyui-textbox" required="true"  type="text" />
								</td>
								<td width="10%"><span>班主任</span></td>
								<td width="15%">
									<input id="classMonitor" name="classMonitor" class="easyui-textbox"  readonly="true"  type="text"/>
								</td>
								<td width="10%"><span>辅导员</span></td>
								<td width="15%">
									<input id="classDirector" name="classDirector" class="easyui-textbox" readonly="true" type="text"/>
								</td>
							</tr>
							<tr>
								<td width="10%"><span>辅导员电话</span></td>
								<td width="15%">
									<input id="directorPhoneNumber" name="directorPhoneNumber" class="easyui-textbox" readonly="true"  type="text"/>
								</td>
							</tr>
						</table>
				</div><!--end of student !-->
				<div id="teacher">
						<table width="100%">
							<tr>
								<td width="10%"><span>工作单位</span></td>
								<td width="15%">
									<input class="easyui-textbox" id="teac_academy" name="teac_academy" type="text" />
								</td>
								<td width="10%"><span>报案电话</span></td>
								<td width="15%">
									<input id="reporterTeacherPhone" name="reportTeacherPhone" class="easyui-textbox" required="true"  type="text" />
								</td>
								<td width="10%"><span>联系电话</span></td>
								<td width="15%">
									<input id="reporterTeacherContactPhone" name="reporterTeacherContactPhone" class="easyui-textbox" required="true" type="text" />
								</td>
								<td width="10%"><span>宿舍楼</span></td>
								<td width="15%">
									<input id="teac_building" name="teac_building" class="easyui-textbox"  type="text" 
									       />
								</td>
							</tr><!--end of tr 1!-->
							<tr>
								<td width="10%" style="padding:0,5px"><span>房间号</span></td>
								<td width="15%" style="padding:0,5px">
									<input id="teac_room" name="teac_room" class="easyui-textbox" 
									   type="text" />
								</td>
								<td width="10%" style="padding:0,5px"><span>部门领导</span></td>
								<td width="15%" style="padding:0,5px">
									<input class="easyui-textbox"  id="departmentLeader" name="departmentLeader" 
									        type="text" />
								</td>
								<td width="10%"><span>领导电话</span></td>
								<td width="15%">
									<input class="easyui-textbox"  id="leaderPhoneNumber" name="leaderPhoneNumber" type="text" />	
								</td>
							</tr>
						</table>
				</div><!--end of div teacher!-->
			  </form>
			</fieldset>
				<div id="event" width="100%">
						<form id="eventForm">
								<fieldset>
										<legend>
												案件基本信息[案件号:<font color="red"><span id="eventId1"></span></font>]
										</legend>
										<table style="width: 100%">
												<tr>
														<td width="10%">案件类型</td>
														<td width="15%"><input class="easyui-combobox"
																id="eventType" name="eventType" style="width: 100%"
																data-options="url:'json/eventType.json', 
							                                                  method:'get',
							                                                  textField:'text',
							                                                  valueField:'text' " />
														</td>
														<td width="10%">主管部门</td>
														<td width="15%"><input class="easyui-combobox"
																id="adminDepartment" name="adminDepartment"
																style="width: 100%"
																data-options="url: 'Resource_departmentList',
															                  method: 'get',
															                  valueField: 'DEPARTMENTNAME',
															                  textField: 'DEPARTMENTNAME'" />
														</td>
														<td width="10%">主管领导</td>
														<td width="15%"><input class="easyui-combobox"
																id="adminDepartmentLeader" name="adminDepartmentLeader"
																style="width: 100%"
																data-options="valueField: 'USERNAME',textField: 'USERNAME'" />
														</td>
														<td width="10%">领导电话</td>
														<td width="15%"><input
																id="adminDepartmentLeaderPhone"
																name="adminDepartmentLeaderPhone"
																class="easyui-textbox" type="text"
																/></td>

												</tr>
												<tr>
														<td width="10%">协助部门</td>
														<td width="15%"><input class="easyui-combobox"
																id="cooperateDepartment" name="cooperateDepartment"
																style="width: 100%"
																data-options="url: 'Resource_departmentList',
															                  method: 'get',
															                  valueField: 'DEPARTMENTNAME',
															                  textField: 'DEPARTMENTNAME'" />
														</td>
														<td width="10%">协管领导</td>
														<td width="15%"><input class="easyui-combobox"
																id="cooperateDepartmentLeader"
																name="cooperateDepartmentLeader" style="width: 100%"
																data-options="valueField: 'USERNAME',textField: 'USERNAME'" />
														<td width="10%">领导电话</td>
														<td width="15%"><input
																id="cooperateDepartmentLeaderPhone"
																name="cooperateDepartmentLeaderPhone"
																class="easyui-textbox" readonly="true" type="text"
																/></td>
														<td width="10%">经办人</td>
														<td width="15%"><input
																class="easyui-textbox" id="executor"
																name="executor"  /></td>
												</tr>
												<tr>
														<td width="10%">经办电话</td>
														<td width="15%"><input id="executorPhone"
																name="executorPhone" class="easyui-textbox"
																 /></td>
														<td width="10%">报案日期</td>
														<td width="15%"><input id="nowDate" name="eventDate"
																class="easyui-textbox"
																/></td>

												</tr>
												<tr>
														<td width="10%"><span>处理方式</span></td>
														<td width="15%"><input type="checkbox" id="smsInform"
																name="smsInform" />短信通知</td>
														<td width="20%"><input type="checkbox"
																id="phoneInform" name="phoneInform" />电话通知</td>

												</tr>
												<tr>
														<td width="10%">通知对象</td>
														<td width="15%">
															<input type="checkbox" id="informExecutor" name="informExecutor" />经办人
														</td>
														<td width="20%">
															<input type="checkbox" id="informAdminDepartmentLeader" name="informAdminDepartmentLeader" />主管领导
														</td>
												</tr>
												<tr>
													<td width="10%"></td>
													<td width="15%">
																	<input type="checkbox" id="informCooperate" name="informCooperate" />协管领导
													</td>
													<td width="20%">
																	<input type="checkbox" id="informClassDirector" name="informClassDirector" />辅导员
													</td>
												</tr>
												<tr>
													<td width="15%">通知其它人</td>
													<td width="15%">
																	<input id="informOthers"
																           name="informOthers" class="easyui-textbox"
																           data-options="prompt:'请输入电话号码'" />
													</td>
												</tr>
												<tr>
														<td width="15%">案件描述</td>

												</tr>
										</table>
										<table width="100%" align="center">
												<tr>
														<td nowrap align="center"><textarea id="eventContent"
																		name="eventContent" id="mainContent" cols="100"
																		rows="15"
																		style="background: url('images/icon_1.png') no-repeat bottom right; resize: none;"
																		class="easyui-validatebox" required="true"
																		missingMessage="请输入内容" placeholder="请输入事件内容"></textarea>
														</td>
												</tr>
										</table>
										<input type="hidden" id="eventId" name="eventId" />
								</fieldset>
						</form>
				</div><!--end of div event!-->
		</div>
<div id="sendSMS" title="发短信给报案人" class="easyui-dialog" modal="true" style="width:400px;height:340px;padding:10px 20px"
            closed="true" buttons="#dlg-buttons">
	
     <form id="fm" method="post" novalidate>
 <!--   <div class="fitem">
       <label>收信人姓名:</label>
                <input name="name" class="easyui-validatebox" required="required" missingMessage="请输入收信人姓名"/>
            </div>
            <div class="fitem">
                <label>收信人手机号:</label>
                <input name="addr" class="easyui-numberbox" required="required" missingMessage="请输入收信人电话号码" invalidMessage="只能为数字"/>
            </div>
            <div class="fitem">
                <textarea name="text" class="easyui-validatebox" missingMessage="简单扼要简述一下事件内容"  rows="14" cols="36" required="true" placeholder="建议70字以内"></textarea>
            </div>
-->
			<table>
				<tr>
					<td>短信收信人</td>
				</tr>
				<tr>
					<td>
						<input id="smsname" name="name" class="easyui-validatebox textbox" style="width:80%;height:20"/>
					</td>
				</tr>
				<tr>
					<td>收信人电话号码</td>
				</tr>
				<tr>
					<td>
						<input id="smsaddr" name="addr" class="easyui-validatebox textbox" style="width:80%;height:20""/>
					</td>
				</tr>
				<tr>
					<td>短信内容<font size="10" color="red">(为减少短信条数，请尽量精简至70字以内)</font></td>
				</tr>
				<tr>
					<td>
						<textarea id="smstext" cols="50" rows="10" >
						</textarea>
					</td>
				</tr>
				<tr>
					<td><input type="hidden" name="text" id="smscontent"/></td>
				</tr>
			</table>
        </form>
</div>

<div id="audioPlayer" title="录音播放" class="easyui-dialog" modal="false" style="width:30%;height:80px;text-aling:center;background-color: black;"
            closed="true">
            <div style="pading:25px;" id="statrAudio"></div>
</div>
<div id="dlg-buttons">
        <a href="javascript:void(0)" class="easyui-linkbutton c6" iconCls="icon-ok"  style="width:90px" onclick="doSendSMS()">发送</a>
        <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#sendSMS').dialog('close')" style="width:90px">取消</a>
</div>
	<script type="text/javascript">
	$("#adminDepartment").combobox({
		onSelect:function(){
			var teac_academy=$(this).combobox('getValue');
			$("#adminDepartmentLeader").combobox('reload','Resource_departmentLeaderList?teac_academy='+teac_academy);
		}
	});
	
	$("#adminDepartmentLeader").combobox({
		onSelect:function(){
			var academy_leader=$(this).combobox('getValue');
			$.ajax({
				url:'Resource_leaderPhoneNumber',
				type:'Post',
				data:'academy_leader='+academy_leader,
				datatype:'json',
				success:function(data){
					//alert(JSON.stringify(data[0]));
					$("#adminDepartmentLeaderPhone").textbox('setValue',data[0].PHONE);
								
				}
			});
		}
	});
	
	$("#cooperateDepartment").combobox({
		onSelect:function(){
			var teac_academy=$(this).combobox('getValue');
			$("#cooperateDepartmentLeader").combobox('reload','Resource_departmentLeaderList?teac_academy='+teac_academy);
		}
	});
	
	$("#cooperateDepartmentLeader").combobox({
		onSelect:function(){
			var academy_leader=$(this).combobox('getValue');
			$.ajax({
				url:'Resource_leaderPhoneNumber',
				type:'Post',
				data:'academy_leader='+academy_leader,
				datatype:'json',
				success:function(data){
					//alert(JSON.stringify(data[0]));
					$("#cooperateDepartmentLeaderPhone").textbox('setValue',data[0].PHONE);
								
				}
			});
		}
	});
	</script>
</body>

</html>